import request from '@/utils/request'

/**
 * 兑换码列表
 * http://192.168.88.247:4999/web/#/80/1298
 * @param {Object} params
 * @returns
 */
export function exchangeCodeList (params) {
  return request({
    url: '/api/v1/exchange_code/list',
    method: 'get',
    params
  })
}
/**
 * 兑换码创建
 * http://192.168.88.247:4999/web/#/80/1296
 * @param {Object} data
 * @returns
 */
export function createExchangeCode (data) {
  return request({
    url: '/api/v1/exchange_code/create',
    method: 'post',
    data
  })
}
/**
 * 兑换码状态更新
 * http://192.168.88.247:4999/web/#/80/1297
 * @param {Object} data
 * @returns
 */
export function updateExchangeCode (data) {
  return request({
    url: '/api/v1/exchange_code/update',
    method: 'put',
    data
  })
}
/**
 * 兑换码删除
 * http://192.168.88.247:4999/web/#/80/1299
 * @param {Object} data
 * @returns
 */
export function delExchangeCode (data) {
  return request({
    url: '/api/v1/exchange_code/del',
    method: 'delete',
    data
  })
}
/**
 * 兑换码详情
 * http://192.168.88.247:4999/web/#/80/1324
 * @param {Object} params
 * @returns
 */
export function exchangeCodeDetail (params) {
  return request({
    url: '/api/v1/exchange_code/detail',
    method: 'get',
    params
  })
}
/**
 * 兑换码使用列表
 * http://192.168.88.247:4999/web/#/80/1327
 * @param {Object} params
 * @returns
 */
export function exchangeCodeExchList (params) {
  return request({
    url: '/api/v1/exchange_code/exch_list',
    method: 'get',
    params
  })
}
/**
 * 兑换码使用列表
 * http://192.168.88.247:4999/web/#/80/1332
 * @param {Object} params
 * @returns
 */
export function exportExchangeCode (params) {
  return request({
    url: '/api/v1/exchange_code/use_export',
    method: 'get',
    params
  })
}
/**
 * 激活码注销时长
 * http://192.168.88.247:4999/web/#/80?page_id=2058
 * @param {Object} data
 * @returns
 */
export function refundCode (data) {
  return request({
    url: '/api/v1/exchange_code/refund_code',
    method: 'post',
    data
  })
}
